using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Pheonix.CodeLibrary.Web;
using Pheonix.CodeLibrary;
using Pheonix.Fashionzoomer.Entity.SqlServer2000;

public partial class page_public_contactus : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Title = SiteName + " - Contact us";
    }

    protected void Send_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
            string name = Utility.FilterInputText(tbxName.Text);
            string email = Utility.FilterInputText(tbxEmail.Text);
            string phone = Utility.FilterInputText(tbxPhone.Text);
            string message = Utility.FilterInputText(tbxMessage.Text);

            int newContactId = Contacts.CreateNewContacts(name, email, phone, message,DateTime.Now);

            if (newContactId > 0)
                uccResponseMessage.SetSuccessMessage("Message sent successfuly.");
            else
                uccResponseMessage.SetFailMessage("There was a problem in sending message");
        }
        else
            uccResponseMessage.SetFailMessage("Could not send because of invalid data.");
            
    }
}
